package _interview75;

/**
 * 1732. 找到最高海拔
 */
public class No1732 {
    public int largestAltitude(int[] gain) {
        int answer = Math.max(gain[0], 0);
        for (int i = 1; i < gain.length; i++) {
            gain[i] = gain[i - 1] + gain[i];
            answer = Math.max(gain[i], answer);
        }
        return answer;
    }
}
